package club.itstudio.itouc.controller

import club.itstudio.itouc.core.util.Result
import club.itstudio.itouc.core.util.ResultUtil
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController
import club.itstudio.itouc.entity.Menu

@RestController
class WebMenu {
    @GetMapping("/menu")
    fun menu(): Result<Any> {
        return ResultUtil.success(menu)
    }
}

// 主页
val main = Menu(title =  "主页",icon =  "layui-icon-home",jump =  "/")
//// 图书馆
//val libSearch = Menu("libSearch", "搜索", jump =  "/menu/library/search")
//val nowLend = Menu("nowLend", "借阅", jump = "/menu/library/nowlend")
//val libraryMenu = Menu("library", "图书馆", "layui-icon-read", list = listOf(libSearch, nowLend))

// 课表
val stuCourse = Menu("userclasslist", "课表", "layui-icon-table",  "/menu/elective/stuCourse")

// 选课
val specialtyCourse = Menu("specialty", "专业课", jump = "/menu/elective/specialty")
val publicCoourse = Menu("public", "公共课", jump = "/menu/elective/publicClassList")
val elective =  Menu("elective", "选课",  "layui-icon-component", list = listOf(specialtyCourse, publicCoourse))

// 快速选课
val common = Menu("commonCourse", "通识", jump = "/menu/quickElective/common")
val commonMooc = Menu("commonMoocCourse", "通识Mooc", jump = "/menu/quickElective/commonMooc")

val advancedEnglish = Menu("advancedEnglish", "英语", jump = "/menu/quickElective/advancedEnglish")
val PECourse = Menu("PECourse", "体育", jump = "/menu/quickElective/PE")
val Physics = Menu("Physics", "物理", jump = "/menu/quickElective/physics")
val Chemistry = Menu("Chemistry", "化学", jump = "/menu/quickElective/chemistry")
val Math = Menu("Math", "数学", jump = "/menu/quickElective/math")
val polityCourse = Menu("PolityCourse", "思政军事", jump = "/menu/quickElective/polity")
val BasicComputer = Menu("BasicComputer", "计算机基础", jump = "/menu/quickElective/basicComputer")

val quickPublicCourse = Menu("quickPublic", "公共基础课", list = listOf(
        advancedEnglish, PECourse, Physics, Chemistry, Math, polityCourse, BasicComputer))

val quickElective = Menu("QuickElective", "快速选课", "layui-icon-senior", list = listOf(
        common, commonMooc, quickPublicCourse))

// 建议课表
val planCourse = Menu("planCourse", "建议课表", "layui-icon-list", "/menu/planCourse")

// 学分要求
val requiredCredit = Menu("requiredCredit", "学分要求", "layui-icon-form", "/menu/requiredCredit")

// 资料区
//val userRes = Menu("userRes", "我的文件", jump = "menu/resource/userRes")
//val courseRes = Menu("courseRes", "公共课资料", jump = "/menu/resource/pubCourseRes")
//val planInfoRes = Menu("planInfoRes", "专业课资料", jump = "/menu/resource/specCourseRes")
//val resourceArea = Menu("resourceArea", "资料区", "layui-icon-read", list = listOf(
//        userRes, courseRes, planInfoRes))

// 菜单栏
private val menu = listOf(main, stuCourse, elective, quickElective, planCourse, requiredCredit)

